/**
 * \file CRequest.h
 * \author Corentin Le Bail
 * \date 2009-2013
 * \brief Fichier de déclaration de la classe CRequest.
 */
//------------------------------------------------------------------------------
#ifndef __CREQUEST_H__
#define __CREQUEST_H__
//------------------------------------------------------------------------------
#include <QObject>
#include <QString>
#include <QDateTime>
#include <QCryptographicHash>
#include "CGlobal.h"
#include "CBaseRequestData.h"
//------------------------------------------------------------------------------
class CRequest : public QObject {
	Q_OBJECT
	Q_PROPERTY(QString token READ getToken)
	Q_PROPERTY(QString requestDate READ getRequestDateFormated);
	Q_PROPERTY(QString hashKey READ getHashKey);
	Q_PROPERTY(QObject* data READ getData);
	public:
		CRequest(void);
		void setToken(QString token) { this->token=token; }
		QString getToken(void) { return token; }
		QString getRequestDateFormated(void) { return requestDate.toUTC().toString(Qt::ISODate); }
		QString getHashKey(void);
		void setData(CBaseRequestData* data) { this->data=data; }
		CBaseRequestData* getData(void) { return data; }
	private:
		QString token;
		QDateTime requestDate;
		CBaseRequestData* data;
};
//------------------------------------------------------------------------------
#endif// __CREQUEST_H__
//------------------------------------------------------------------------------